package com.xunkids.bos.migration.app.configuration;


import com.xunkids.bos.migration.common.constant.QueueType;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.Map;

/**
 * 系统队列配置
 *
 * @author xigexb
 * @version 1.0.0
 * @since 2022/5/22 17:07
 */
@ConfigurationProperties(prefix = "system.queue")
public class SysQueueProperties implements SystemQueueProperties {


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Map<String, String> getConfigKV() {
        return configKV;
    }

    public void setConfigKV(Map<String, String> configKV) {
        this.configKV = configKV;
    }

    public Map<String, String> getTopicKV() {
        return topicKV;
    }

    public void setTopicKV(Map<String, String> topicKV) {
        this.topicKV = topicKV;
    }

    /**
     * 队列类型
     */
    private String type;

    /**
     * 配置KV
     */
    private Map<String, String> configKV;

    /**
     * 主题KV
     */
    private Map<String, String> topicKV;

    /**
     * queue 类型
     *
     * @return Queue 类型
     */
    @Override
    public QueueType queueType() {
        return QueueType.valueOf(this.type);
    }

    /**
     * 配置KV
     */
    @Override
    public Map<String, String> queueConfig() {
        return this.configKV;
    }

    /**
     * 主题KV
     */
    @Override
    public Map<String, String> topicConfig() {
        return this.topicKV;
    }
}
